Currently, in many application scenarios, a user terminal may access a wide area network (WAN) using a gateway, and a system administrator may use a controller to manage a large quantity of gateways.
The gateway accesses the controller using the WAN, and the controller and the gateway may transmit control information according to the Network Configuration Protocol (NETCONF). An Extensible Markup Language (XML) is used in the NETCONF to encapsulate the control information. Content in an XML encoded message (which is referred to as an XML message) is easy to read, and a peer end can parse the control information in the XML message without referring to other information. However, because the XML message includes a relatively large amount of control information, transmission efficiency is relatively low when the control information is transmitted using the XML message. Therefore, during transmission of the XML message, the XML message is compressed to improve information transmission efficiency and save transmission bandwidth. Meanwhile, compression of the XML message increases load on a processor, and increases a processing time.
In addition, in a current solution, a compression method is determined by negotiation when a connection for information transmission is established to the peer end, and does not change after the connection is established. A same compression parameter is used to compress the XML message each time before the XML message is transmitted to the peer end, and consequently central processing unit (CPU) processing load is relatively heavy, and a processing time is increased. Alternatively, no compression is performed during transmission of the XML message, and this causes over occupation of bandwidth.